/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

@Serializable()
export class UserInfo {
  @JsonProperty('userId')
    userId: number = 0;

  @JsonProperty('nickName')
    nickName: string = '';

  @JsonProperty('email')
    email: string = '';

  @JsonProperty('phonenumber')
    phonenumber: string = '';

  @JsonProperty('userName')
    userName: string = '';

  @JsonProperty('sex')
    sex: string = '';

  @JsonProperty('avatar')
    avatar: string = '';

  @JsonProperty('realFlag')
    realFlag: number = 0;

  @JsonProperty('superFlag')
    superFlag: number = 0;

  @JsonProperty('realId')
    realId: string = '';

  @JsonProperty('realName')
    realName: string = '';

  @JsonProperty('inviteCode')
    inviteCode: string = '';

  @JsonProperty('balance')
    balance: number = 0;

  @JsonProperty('status')
    status: string = '';

  @JsonProperty('wechatOpenId')
    wechatOpenId: string = '';

  get boolWechatOpenId() {
    return Boolean(this.wechatOpenId);
  }

  @JsonProperty('freezeBalance')
    freezeBalance: number = 0;
}

@Serializable()
export default class UserInfoInstance {
  @JsonProperty({ name: 'data', type: UserInfo })
    userInfo: UserInfo = new UserInfo();
}
